﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='budget_select' and s.name='Budget')
DROP PROCEDURE [Budget].budget_select
GO
CREATE PROCEDURE [Budget].budget_select 
@PK uniqueidentifier
AS
BEGIN
SELECT 	
	[Budgets].[id_budget] AS [PK],
	[Budgets].[id_main_budget] AS [MainBudgetID],
	[Budgets].[name] AS [Name],
	[Budgets].[start] AS [Start],
	[Budgets].[end] AS [End],
	[Budgets].[comment] AS [Comment],
	[Budgets].[last_version] AS [LastVersion],
	[Budgets].[validated] AS [Validated]
FROM 
	[Budgets] 
WHERE
	[Budgets].[id_budget] = @PK 
END